//
//  YSClubDataTool.h
//  Yueshi
//
//  Created by yueshi_tech on 15/7/15.
//  Copyright (c) 2015年 悦食中国. All rights reserved.
//

#import "BaseDataTool.h"
#import "YSProductDetailRes.h"
#import "YSCartRes.h"
#import "YSAccountCenterRes.h"
#import "YSAddOrderRes.h"
#import "YSHomeInfoRes.h"
#import "YSInterestGroupRes.h"
#import "YSCommentMsgRes.h"
#import "YSTopicListRes.h"
#import "YSGroupDetail.h"


@interface YSClubDataTool : BaseDataTool

/**
 * 获取兴趣小组信息
 */
+(void)getInterestGroup:(void(^)(YSInterestGroupRes *result)) success failure:(void(^)(NSError *error)) failure;

/**
 *  获取俱乐部信息
 *
 *  @param success
 *  @param failure
 */
+ (void)getClubInfo:(void (^)(YSHomeInfoRes *result))success failure:(void (^)(NSError *error))failure;

/**
 *  获取商品详情
 *
 *  @param prodId  商品id
 *  @param success
 *  @param failure
 */
+ (void)getProductDetail:(NSInteger)prodId isLogin:(BOOL)isLogin success:(void(^)(YSProductDetailRes *result))success failure:(void(^)(NSError *error))failure;
/**
 *  商品收藏
 *
 *  @param prodId  商品id
 *  @param isMark  是否收藏 1收藏，0删除收藏
 *  @param success
 *  @param failure
 */
+ (void)markProductWithProdId:(NSString *)prodId isMark:(NSInteger)isMark success:(void(^)(BaseResponse *result))success failure:(void(^)(NSError *error))failure;

/**
 *  添加商品到购物篮
 *
 *  @param prodId    商品id
 *  @param prodCount 商品数量
 *  @param success
 *  @param failure
 */
+ (void)addCartWithParam:(NSInteger)prodId prodCount:(NSInteger)prodCount type:(NSInteger)type success:(void(^)(BaseResponse *result))success failure:(void(^)(NSError *error))failure;
/**
 *  删除购物篮商品
 *
 *  @param prodId  商品id
 *  @param success
 *  @param failure
 */
+ (void)deleteCartWithParam:(NSInteger)prodId success:(void(^)(BaseResponse *result))success failure:(void(^)(NSError *error))failure;
/**
 *  获取购物篮信息
 *
 *  @param success
 *  @param failure 
 */
+ (void)getCartInfo:(void(^)(YSCartRes *result))success failure:(void(^)(NSError *error))failure;
/**
 *  清除过期商品
 *
 *  @param success
 *  @param failure
 */
+ (void)expiredCart:(void(^)(BaseResponse *result))success failure:(void(^)(NSError *error))failure;

/**
 *  获取结算中心信息
 *
 *  @param orderCode 订单编号，更换支付方式的时候可以用上
 *  @param prodIds   不传则是购物篮内所有商品
 *  @param success
 *  @param failure
 */
+ (void)getAccountCenterWithOrderCode:(NSString *)orderCode prodIds:(NSString *)prodIds success:(void(^)(YSAccountCenterRes *result))success failure:(void(^)(NSError *error))failure;

/**
 *  新增订单
 *
 *  @param addressId  地址
 *  @param payMode    支付方式 2支付宝 3微信  4 applePay
 *  @param orderCode  重新支付订单号
 *  @param userRemark 用户备注
 *  @param success
 *  @param failure
 */
+ (void)addOrderWithAddressId:(NSInteger)addressId payMode:(NSInteger)payMode orderCode:(NSString *)orderCode userRemark:(NSString *)userRemark volumePhone:(NSString *)valumePhone voucherId:(NSInteger)voucherId success:(void(^)(YSAddOrderRes *result))success failure:(void(^)(NSError *error))failure;

/**
 *  新增订单
 *  @param prodId
 *  @param lastCommentId
 *  @param success
 *  @param failure
 */
+ (void)getProductComment:(NSInteger)prodId lastCommentId:(NSInteger)lastCommentId success:(void(^)(YSProductDetailRes *result))success failure:(void(^)(NSError *error))failure;
/**
 *  评价订单商品
 *  @param orderCode        订单号
 *  @param commentContent   评价组成的json
 *  @param success
 *  @param failure
 */
+ (void)recommentProductWithOrderCode:(NSString *)orderCode commentContent:(NSString *)commentContent success:(void(^)(BaseResponse *result))success failure:(void(^)(NSError *error))failure;

/**
 *  消息列表
 *  @param pageIndex   页码
 *  @param success
 *  @param failure
 */
+ (void)getMessageListWithPageIndex:(NSInteger)pageIndex success:(void(^)(YSCommentMsgRes *)) success failure:(void(^) (NSError *error)) failure;

/**
 *  获取主题列表
 *  @param groupId   小组id
 *  @param pageIndex 页码
 *  @param lastId 页面上reviews最后一个id
 */
+ (void)getTopicListWithGroupId:(NSInteger)groupId pageIndex:(NSInteger)pageIndex lastId:(NSInteger)lastId success:(void(^)(YSTopicListRes *)) success failure:(void(^) (NSError *error)) failure;

/**
 *  获取小组介绍
 *  @param groupId   小组id
 */
+ (void)getGroupDetailWithGroupId:(NSInteger)groupId success:(void(^)(YSGroupDetail *)) success failure:(void(^) (NSError *error)) failure;

/**
 *  兴趣小组关注
 *  @param groupId   小组id
 *  @param type int 必须 1为取消关注，其他为关注
 */
+ (void)attentionWithGroupId:(NSInteger)groupId type:(NSInteger)type success:(void(^)(BaseResponse *)) success failure:(void(^) (NSError *error)) failure;

/**
 *  兴趣小组关注
 *  @param reviewsId   内容页id
 *  @param type  1 为取消点赞，其他为点赞
 */
+ (void)praiseWithReviewsId:(NSInteger)reviewsId type:(NSInteger)type success:(void(^)(BaseResponse *)) success failure:(void(^) (NSError *error)) failure;
@end
